package com.study.sbsummary.utils;

import org.apache.commons.lang3.StringUtils;

public class DocUtil {

    public static String getDocIdPrefix(String docId) {
        if(StringUtils.isBlank(docId)){
            throw new IllegalArgumentException("docId不能为空");
        }
        int pos = docId.indexOf("_");
        if (pos == -1){
            throw new IllegalArgumentException("docId必须包含_");
        }
        String result = docId.substring(0, pos);
        return result;
    }

}
